package com.satan.fmmall.controller;

import com.satan.fmmall.service.ProductParamsService;
import com.satan.fmmall.vo.ResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName ProductParamsController
 * @Description TODO
 * @date 2022/4/22 12:27
 * @Version 1.0
 */
@RestController
@Api(tags = "商品参数接口",value = "提供商品参数查询的接口")
@RequestMapping("/product-params")
public class ProductParamsController {
    @Resource
    private ProductParamsService productParamsService;

    @ApiOperation("根据类别查询商品品牌接口")
    @GetMapping("/list-brands/{categoryId}")
    public ResultVo getBrandsByCategoryId(@PathVariable("categoryId")Integer categoryId){
        return productParamsService.listBrands(categoryId);
    }

    @ApiOperation("根据关键字查询商品品牌接口")
    @GetMapping("/list-brands-keyword/{keyword}")
    public ResultVo getBrandsByKeyword(@PathVariable("keyword")String keyword){
        return productParamsService.listBrands(keyword);
    }




}
